package com.jiawei.note.base;

import android.os.Bundle;

import com.gyf.immersionbar.ImmersionBar;
import com.jiawei.note.R;

import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;


public abstract class BaseActivity<VDB extends ViewDataBinding> extends AppCompatActivity {
   protected VDB binding;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        ImmersionBar
                .with(this)
                .fitsSystemWindows(true)//解决状态栏和布局重叠问题，任选其一
                .statusBarColor(R.color.green)//状态栏颜色，不写默认透明色
                .init();
        binding = DataBindingUtil.setContentView(this,getLayout());
        iniView();
        initData();
        initListener();
    }

    protected abstract void iniView();

//    public abstract int getStatusBarColor();
   public abstract int getLayout();
   public abstract void initData();
   public abstract void initListener();



}
